package com.ruoyi.class_management.service.impl;

import java.rmi.server.UID;
import java.util.List;
import java.util.UUID;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.class_management.mapper.TbClassMoralEducationMapper;
import com.ruoyi.class_management.domain.TbClassMoralEducation;
import com.ruoyi.class_management.service.ITbClassMoralEducationService;

/**
 * 班级德育Service业务层处理
 *
 * @author ruoyi
 * @date 2023-12-26
 */
@Service
public class TbClassMoralEducationServiceImpl implements ITbClassMoralEducationService
{
    @Autowired
    private TbClassMoralEducationMapper tbClassMoralEducationMapper;

    /**
     * 查询班级德育
     *
     * @param id 班级德育主键
     * @return 班级德育
     */
    @Override
    public TbClassMoralEducation selectTbClassMoralEducationById(String id)
    {
        return tbClassMoralEducationMapper.selectTbClassMoralEducationById(id);
    }

    /**
     * 查询班级德育列表
     *
     * @param tbClassMoralEducation 班级德育
     * @return 班级德育
     */
    @Override
    public List<TbClassMoralEducation> selectTbClassMoralEducationList(TbClassMoralEducation tbClassMoralEducation)
    {
        return tbClassMoralEducationMapper.selectTbClassMoralEducationList(tbClassMoralEducation);
    }

    /**
     * 新增班级德育
     *
     * @param tbClassMoralEducation 班级德育
     * @return 结果
     */
    @Override
    public int insertTbClassMoralEducation(TbClassMoralEducation tbClassMoralEducation)
    {
//        tbClassMoralEducation.setCreateTime(DateUtils.getNowDate());
        tbClassMoralEducation.setId(UUID.randomUUID().toString().replace("-",""));
        return tbClassMoralEducationMapper.insertTbClassMoralEducation(tbClassMoralEducation);
    }

    /**
     * 修改班级德育
     *
     * @param tbClassMoralEducation 班级德育
     * @return 结果
     */
    @Override
    public int updateTbClassMoralEducation(TbClassMoralEducation tbClassMoralEducation)
    {
        tbClassMoralEducation.setUpdateTime(DateUtils.getNowDate());
        return tbClassMoralEducationMapper.updateTbClassMoralEducation(tbClassMoralEducation);
    }

    /**
     * 批量删除班级德育
     *
     * @param ids 需要删除的班级德育主键
     * @return 结果
     */
    @Override
    public int deleteTbClassMoralEducationByIds(String[] ids)
    {
        return tbClassMoralEducationMapper.deleteTbClassMoralEducationByIds(ids);
    }

    /**
     * 删除班级德育信息
     *
     * @param id 班级德育主键
     * @return 结果
     */
    @Override
    public int deleteTbClassMoralEducationById(String id)
    {
        return tbClassMoralEducationMapper.deleteTbClassMoralEducationById(id);
    }
}
